/**
 * 
 */
package org.spring.batch.ch05;

import org.spring.batch.ch05.model.Group;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.file.transform.FieldSet;
import org.springframework.validation.BindException;

public class GroupFieldSetMapper implements FieldSetMapper<Group> {

	public Group mapFieldSet(FieldSet fieldSet) throws BindException {
		Group group = new Group();
		group.setName(fieldSet.readString("NAME"));
		group.setDescription(fieldSet.readString("DESCRIPTION"));
		return group;
	}

}
